"""
GT-LMS System Demo Script
This script demonstrates various system functions
"""

import sys
import os

# Add project root directory to Python path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))

from system.lms_system import LMSSystem
from ui.cli import CLI


def demo_system():
    """Demonstrate system functionality"""
    print("GT-LMS Learning Management System Demo")
    print("=" * 40)

    # Create system instance
    print("1. Initialize system...")
    lms_system = LMSSystem()

    # Initialize system
    if lms_system.initialize():
        print("   [Success] System initialization completed")
    else:
        print("   [Failed] System initialization failed")
        return

    # Create test data
    print("\n2. Create test data...")
    if lms_system.create_test_data():
        print("   [Success] Test data creation completed")
    else:
        print("   [Failed] Test data creation failed")
        return

    # Save data
    print("\n3. Save data...")
    if lms_system.save_data():
        print("   [Success] Data saving completed")
    else:
        print("   [Failed] Data saving failed")
        return

    # Display system statistics
    print("\n4. System statistics:")
    stats = lms_system.get_statistics()
    for key, value in stats.items():
        print(f"   {key}: {value}")

    # Backup system data
    print("\n5. System backup...")
    if lms_system.backup_system():
        print("   [Success] System backup completed")
    else:
        print("   [Failed] System backup failed")
        return

    # List backups
    print("\n6. Backup list:")
    backups = lms_system.list_backups()
    for backup in backups:
        print(f"   {backup}")

    print("\n" + "=" * 40)
    print("Demo completed! System is ready to use.")
    print("Run 'python main.py' to start the system.")


if __name__ == "__main__":
    demo_system()